package com.supermarket.manage.common.dto.ucenter.request;

import com.supermarket.manage.common.validation.CheckGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author Faxon
 * @version 1.0
 * @date 2020-02-28 18:02
 **/
@Data
@ApiModel("UserPageParams:用户分页、条件查询数据对象")
public class UserPageParams implements Serializable {

    private static final long serialVersionUID = 9154508155884021718L;
    /**
     * 页码
     */
    @ApiModelProperty(value = "页码")
    @NotNull(message = "页码不能为空", groups = {CheckGroup.Page.class})
    private Integer page;

    /**
     * 每页条目数
     */
    @ApiModelProperty(value = "每页条目数")
    @NotNull(message = "每页条目数不能为空", groups = {CheckGroup.Page.class})
    private Integer size;

    /**
     * 当前用户id
     */
    @ApiModelProperty(value = "当前用户id")
    @NotBlank(message = "当前用户id不能为空", groups = {CheckGroup.Page.class, CheckGroup.Get.class})
    private String userId;

    /**
     * 客户id
     */
    @ApiModelProperty(value = "客户id")
    @NotBlank(message = "客户id不能为空")
    private String buyerId;

    /**
     * 角色id
     */
    @ApiModelProperty(value = "角色id")
    @Range(min = 1L, max = 2L, message = "角色id")
    private Long roleId;

    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名")
    private String username;

    /**
     * 注册手机号
     */
    @ApiModelProperty(value = "注册手机号")
    private String phone;


    /**
     * 注册时间前缀
     */
    @ApiModelProperty(value = "注册时间前缀 yyyy-MM-dd HH:mm:ss")
    private String beginTime;

    /**
     * 注册时间后缀
     */
    @ApiModelProperty(value = "注册时间后缀 yyyy-MM-dd HH:mm:ss")
    private String endTime;

}
